import App from "@/App";
// import Fast from "@/views/Fast";
// import Home from "@/views/Home";
import Login from "@/views/Login";
// import Mine from "@/views/Mine";
// import Practice from "@/views/Practice";
// import Select from "@/views/Select";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
// react里面的路由懒加载
// React.lazy(()=>import(组件的路径))
import { lazy } from "react";
import CSSInJS from "@/views/CSSInJS";
const Home = lazy(() => import("../views/Home"));
const Fast = lazy(() => import("../views/Fast"));
const Mine = lazy(() => import("../views/Mine"));
const Select = lazy(() => import("../views/Select"));
const Practice = lazy(() => import("../views/Practice"));
const router = (
  <Router>
    <Routes>
      <Route path="/" element={<App />}>
        <Route path="home" element={<Home />}></Route>
        <Route path="fast" element={<Fast />}></Route>
        <Route path="mine" element={<Mine />}></Route>
        <Route path="select/:actionCode" element={<Select />}></Route>
        <Route path="practice" element={<Practice />}></Route>
      </Route>
      <Route path="/login" element={<Login />}></Route>
      <Route path="/cssinjs" element={<CSSInJS />}></Route>
    </Routes>
  </Router>
);

export default router;
